<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=100, initial-scale=1.0" />
    <meta http-equiv="pragma" content="no-cache" />
    <meta http-equiv="cache-control" content="no-cache" />
    <meta http-equiv="expires" content="" />
    <title>武陵游</title>
    <link rel="stylesheet" type="text/css" href="/paycss/style.css" />
    <script src="/payjs/jquery.min.js"></script>
    <script src="/payjs/layer/layer.js"></script>
    <script src="/payjs/jweixin-1.6.0.js "></script>
    <script src="/payjs/ajax.js "></script>
    <script>

        var _code = getParameterStr("code");
        var pid = getParameterStr("pid"); // 用户id
        var aid = getParameterStr("aid"); // 微信appId
        var t =Number(getParameterStr("t")) ; // 是否给自己充值
        var m = Number(getParameterStr("m")); // 金额
        var r = Number(getParameterStr("r")); // 钻石
        var dit = Number(getParameterStr("dit")); // 项目


        var _jumpValue = getParameterStr("j"); // 是否有跳转过的状态

        $(function () {
            // 获取 appId 数据配置获取
            if (!_code || _code == "") {
                signatureHandler(false);
            } else {
                console.log("_code", _code);
                console.log("_pid", pid);
                console.log("_aid", aid);
                console.log("_t", t);
                console.log("_m", m);
                console.log("_r", r);
                console.log("dit", dit);
            }
        });
        function back() {
            history.go(-3);
        }
        // 跳转微信授权
        function signatureHandler(hasCode) {
            var _appId = getAppId();
            alertHandler("跳转用的appId" + _appId);

            var _paramStr = "?pid=" + pid + "&t=" + t + "&m=" + m + "&r=" + r;
            if (hasCode) {
                _paramStr += "&aid=" + _appId + "&j=1";
            } else {
                _paramStr += "&aid=" + _appId;
            }
            var _redirectUri = encodeURIComponent(
                location.protocol +
                "//" +
                location.host +
                "/redirect/url" +
                _paramStr
            );
            var _signatureUrl =
                "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" +
                _appId +
                "&redirect_uri=" +
                _redirectUri +
                "&response_type=code&scope=snsapi_userinfo&state=#wechat_redirect";
            location.href = _signatureUrl;
        }

        function getAppId() {
            if (aid && aid != null && aid !== "") {
                return aid;
            }
            return "wxa16b486ee8fc0c8e";
        }

        // 根据键获取url参数值
        function getParameterStr(name) {
            let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
            let r = location.search.substr(1).match(reg);
            if (r != null) return decodeURI(decodeURIComponent(decodeURI(r[2])));
            return "";
        }
        function alertHandler(info) {
            // alert(info)
        }
    </script>
</head>

<body>
<div class="order_info">
    <p class="title"></p>
    <p class="product_name">商品名称：<span id="masonryNum"></span></p>
    <p class="order_player">充值账户：<span id="nickname"></span></p>
    <p class="order_money">支付金额：<span id="payMoney"></span></p>
</div>
<div class="btns">
    <button class="button back" type="button" onclick="back()">返回</button>
    <button class="button pay" type="button" onclick="payHandler()">
        支付
    </button>
</div>
<div class="order_warn">
    <p class="title">充值说明：</p>
    <p>1.钻石商品为虚拟物品，一经出售，概不退还</p>
    <p>2.支付遇到问题?请联系客服微信:cdkf008</p>
    <p>3.请合理安排时间,享受健康生活.</p>
</div>
</body>
</html><!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=100, initial-scale=1.0" />
    <meta http-equiv="pragma" content="no-cache" />
    <meta http-equiv="cache-control" content="no-cache" />
    <meta http-equiv="expires" content="" />
    <title>武陵游</title>
    <link rel="stylesheet" type="text/css" href="/paycss/style.css" />
    <script src="/payjs/jquery.min.js"></script>
    <script src="/payjs/layer/layer.js"></script>
    <script src="/payjs/jweixin-1.6.0.js "></script>
    <script src="/payjs/ajax.js "></script>
    <script>

        var _code = getParameterStr("code");
        var pid = getParameterStr("pid"); // 用户id
        var aid = getParameterStr("aid"); // 微信appId
        var t =Number(getParameterStr("t")) ; // 是否给自己充值
        var m = Number(getParameterStr("m")); // 金额
        var r = Number(getParameterStr("r")); // 钻石
        var dit = Number(getParameterStr("dit")); // 项目


        var _jumpValue = getParameterStr("j"); // 是否有跳转过的状态

        $(function () {
            // 获取 appId 数据配置获取
            if (!_code || _code == "") {
                signatureHandler(false);
            } else {
                console.log("_code", _code);
                console.log("_pid", pid);
                console.log("_aid", aid);
                console.log("_t", t);
                console.log("_m", m);
                console.log("_r", r);
                console.log("dit", dit);
            }
        });
        function back() {
            history.go(-3);
        }
        // 跳转微信授权
        function signatureHandler(hasCode) {
            var _appId = getAppId();
            alertHandler("跳转用的appId" + _appId);

            var _paramStr = "?pid=" + pid + "&t=" + t + "&m=" + m + "&r=" + r;
            if (hasCode) {
                _paramStr += "&aid=" + _appId + "&j=1";
            } else {
                _paramStr += "&aid=" + _appId;
            }
            var _redirectUri = encodeURIComponent(
                location.protocol +
                "//" +
                location.host +
                "/redirect/url" +
                _paramStr
            );
            var _signatureUrl =
                "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" +
                _appId +
                "&redirect_uri=" +
                _redirectUri +
                "&response_type=code&scope=snsapi_userinfo&state=#wechat_redirect";
            location.href = _signatureUrl;
        }

        function getAppId() {
            if (aid && aid != null && aid !== "") {
                return aid;
            }
            return "wxa16b486ee8fc0c8e";
        }

        // 根据键获取url参数值
        function getParameterStr(name) {
            let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
            let r = location.search.substr(1).match(reg);
            if (r != null) return decodeURI(decodeURIComponent(decodeURI(r[2])));
            return "";
        }
        function alertHandler(info) {
            // alert(info)
        }
    </script>
</head>

<body>
<div class="order_info">
    <p class="title"></p>
    <p class="product_name">商品名称：<span id="masonryNum"></span></p>
    <p class="order_player">充值账户：<span id="nickname"></span></p>
    <p class="order_money">支付金额：<span id="payMoney"></span></p>
</div>
<div class="btns">
    <button class="button back" type="button" onclick="back()">返回</button>
    <button class="button pay" type="button" onclick="payHandler()">
        支付
    </button>
</div>
<div class="order_warn">
    <p class="title">充值说明：</p>
    <p>1.钻石商品为虚拟物品，一经出售，概不退还</p>
    <p>2.支付遇到问题?请联系客服微信:cdkf008</p>
    <p>3.请合理安排时间,享受健康生活.</p>
</div>
</body>
</html>